﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using TemplateTEst.Abstract;
using TemplateTEst.Concrete.Table;

namespace TemplateTEst
{
    class MyClass
    {
        public string Var1 { get; set; }
        public MyClass1 myclass1 { get; set; }

    }
    class MyClass1
    {
        public string Var2 { get; set; }
        public MyClass2 myClass2 { get; set; }
    }

    class MyClass2
    {
        public string Var3 { get; set; }
    }

    class Program
    {
        private static T GetXmlNodeValue<T>(string key, XmlNode node)
        {
            return (T)Convert.ChangeType(node[key].Value, typeof(T));
        }
        static void Main(string[] args)
        {
            MyClass m = new MyClass();
            m.Var1 = "1";
            m.myclass1 = new MyClass1();
            m.myclass1.Var2 = "2";
            m.myclass1.myClass2 = new MyClass2();
            m.myclass1.myClass2.Var3 = "3";

           var Pro=  m.GetType().GetProperties().First();

            

            



            //object deneme = null;

            //var d = (MyClass)deneme;

            ////var deger = GetXmlNodeValue<string>(deneme, new MyClass());

            //List<string> l = null;

            //foreach (var item in l)
            //{

            //}
            //TempControl control = new Table();

            //control = new AccountTable();

            //control = new Table();

            //Data d = new Data();


            //var value = "1.000";

            //var dec = Convert.ToDecimal(value);
            //Console.WriteLine(dec);

            Console.ReadLine();



        }


    }

    static class deneme
    {

        public static void Ex(this Data data)
        {
            Console.WriteLine("alert");
        }
    }
    class Data
    {
        public string Name { get; set; }
        public string Surname { get; set; }
        public string No { get; set; }
        public string Adress { get; set; }
        public int Old { get; set; }
        public string Sex { get; set; }

        public static List<Data> GetData()
        {
            var result = new List<Data>();

            for (int i = 0; i < 10; i++)
            {
                result.Add(new Data
                {
                    Adress = "adres" + i,
                    Name = "name" + i,
                    No = i.ToString(),
                    Old = i * 10,
                    Sex = i % 2 == 0 ? "e" : "f",
                    Surname = "Surname" + i,
                });
            }

            return result;
        }
    }




}
